/**
 *       Copyright (c) 2012 Lukas Zaruba
 *
 *   This file is part of Robot Playground.
 *
 *   Robot Playground is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU Lesser General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   Robot Playground is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU Lesser General Public License for more details.
 *
 *   You should have received a copy of the GNU Lesser General Public License
 *   along with Robot Playground. If not, see <http://www.gnu.org/licenses/>.
 */
package net.zarubsys.robotplayground.gui.dummydevice.plugin;

import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.plugin.AbstractUIPlugin;

/**
 * DummyDeviceGUIPlugin
 *
 * @author Lukas Zaruba, lukas.zaruba@gmail.com
 */
public class DummyDeviceGUIPlugin extends AbstractUIPlugin {
	
	public static final String PLUGIN_ID = "net.zarubsys.robotplayground.gui.dummydevice";
	
	public static final String DUMMY_DEVICE = "dummyDevice";
	public static final String DUMMY_MOTION = "dummyMotion";
	public static final String DUMMY_TELEMETRY = "dummyTelemetry";
	public static final String DUMMY_POSITION = "dummyPosition";
	public static final String DUMMY_OBSTACLES = "dummyObstacles";
	public static final String OBSTACLE = "obstacle";
	public static final String CAR = "car";

	private static DummyDeviceGUIPlugin INSTANCE;
	
	public DummyDeviceGUIPlugin() {
		INSTANCE = this;
	}
	
	public static DummyDeviceGUIPlugin getDefault() {
		return INSTANCE;
	}
	
	@Override
	protected void initializeImageRegistry(ImageRegistry reg) {
		super.initializeImageRegistry(reg);
		reg.put(DUMMY_DEVICE, imageDescriptorFromPlugin(PLUGIN_ID, "images/dummyDevice.png"));
		reg.put(DUMMY_MOTION, imageDescriptorFromPlugin(PLUGIN_ID, "images/dummyMotionModule.png"));
		reg.put(DUMMY_TELEMETRY, imageDescriptorFromPlugin(PLUGIN_ID, "images/dummyTelemetryModule.png"));
		reg.put(DUMMY_POSITION, imageDescriptorFromPlugin(PLUGIN_ID, "images/dummyPositionMonitor.png"));
		reg.put(DUMMY_OBSTACLES, imageDescriptorFromPlugin(PLUGIN_ID, "images/dummyObstaclesModule.png"));
	}
	
	public Image getImage(String imageKey) {
		return DummyDeviceGUIPlugin.getDefault().getImageRegistry().get(imageKey);
	}

}

